﻿<UserControl x:Class="TodoApp.Features.Tasks.Create"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:Tasks="clr-namespace:TodoApp.Features.Tasks"
        mc:Ignorable="d"
        d:DataContext="{d:DesignInstance Tasks:CreateViewModel}">
    <Grid Margin="12">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <Label VerticalAlignment="Center"
               Content="_Title: " />

        <TextBox Text="{Binding Title, UpdateSourceTrigger=PropertyChanged}"
                 Grid.Column="1"
                 Margin="3" />

        <Label VerticalAlignment="Center"
               Grid.Row="1"
               Content="Due _Date: " />
        
        <DatePicker SelectedDate="{Binding DueDate}"
                    Grid.Row="1"
                    Grid.Column="1"
                    Margin="3" />
        
        <StackPanel Orientation="Horizontal"
                    HorizontalAlignment="Center"
                    Grid.Row="3"
                    Grid.ColumnSpan="2">
            <Button Content="c_reate"
                    Style="{DynamicResource ChromelessButtonStyle}"
                    Foreground="{DynamicResource AccentColorBrush}"
                    FontSize="24"
                    Command="{Binding CreateCommand}"
                    Margin="5"
                    IsDefault="True"/>
            <Button  Content="_cancel"
                     Style="{DynamicResource ChromelessButtonStyle}"
                     Foreground="{DynamicResource AccentColorBrush}"
                     FontSize="24"
                     Command="{Binding CancelCommand}"
                     Margin="5"
                     IsCancel="True"/>
        </StackPanel>        
    </Grid>
</UserControl>
